package mest.service.Modeling.Impl;

import mest.VO.Modeling.WorkrouteWork_manytomany.workVO;
import mest.dao.Modeling.IworkRouteFileDao;
import mest.entity.work_route;
import mest.entity.workroutework_manytomany;
import mest.service.Modeling.IworkRouteService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Description
 * @auther Machenike
 * @create 2019-11-16 22:08
 */
@Service
public class IworkRouteServiceImpl implements IworkRouteService {

    @Resource
    private IworkRouteFileDao iwrfd;

    @Override
    public int insertWorkRouteType(work_route ct,String theirDb) {
        try {
            return iwrfd.insertWorkRouteType(ct, theirDb);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return -1;
    }

    @Override
    public int selectCount(String theirDb) {
        return iwrfd.selectCount(theirDb);
    }

    @Override
    public List<work_route> findWorkRoutePage(int index, int pageSize,String theirDb) {
        return iwrfd.findWorkRoutePage((index-1)*pageSize,pageSize, theirDb);
    }

    @Override
    public List<workVO> findWorkByWRId(int id,int index,int pageSize,String theirDb) {
        return iwrfd.findWorkByWRId(id,(index-1)*pageSize,pageSize, theirDb);
    }

    @Override
    public int WorkCount(int id,String theirDb) {
        return iwrfd.WorkCount(id, theirDb);
    }

    @Override
    public int insertManytomany_WorkAndWorkRoute(workroutework_manytomany wwmtm,String theirDb) {
        return iwrfd.insertManytomany_WorkAndWorkRoute(wwmtm, theirDb);
    }

    @Override
    public int updateManytomany_WorkAndWorkRoute(workVO wwmtm,String theirDb) {
        return iwrfd.updateManytomany_WorkAndWorkRoute(wwmtm, theirDb);
    }
}
